package mks.webshop.entity;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@SuppressWarnings("serial")
@PersistenceCapable
public class Order extends BaseEntity implements Serializable{

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.SEQUENCE)
	private Long key;
	
	@Persistent
	private String code;
	
	@Persistent
	private String customerName;
	
	@Persistent
	private String customerEmail;
	
	@Persistent
	private String customerPhone;
	
	@Persistent
	private String deliveryNo;
	
	@Persistent
	private String deliveryStreet;
	
	@Persistent
	private String deliveryWard;
	
	@Persistent
	private String deliveryDistrict;
	
	@Persistent
	private String deliveryTime;
	
	@Persistent
	private String deleveryNote;
	
	@Persistent
	private long basePrice;
	
	@Persistent
	private long shipping;
	
	@Persistent
	private long totalPrice;
	
	@Persistent
	private boolean isDone;
	
	@Persistent
	private Date created;
	
	@Persistent
	private String createdBy;
	
	@Persistent
	private Date lastModified;
	
	@Persistent
	private String lastModifiedBy;
	
	public Order(){}
	
	public Order(String code, String customerName, String customerEmail, String customerPhone, long totalPrice, boolean isDone){
		this.code = code;
		this.customerName = customerName;
		this.customerEmail = customerEmail;
		this.customerPhone = customerPhone;
		this.totalPrice = totalPrice;
		this.isDone = isDone;
	}
	public Long getKey() {
		return key;
	}

	public void setKey(Long key) {
		this.key = key;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public String getCustomerEmail() {
		return customerEmail;
	}

	public void setCustomerEmail(String customerEmail) {
		this.customerEmail = customerEmail;
	}

	public String getCustomerPhone() {
		return customerPhone;
	}

	public void setCustomerPhone(String customerPhone) {
		this.customerPhone = customerPhone;
	}
	
	public long getBasePrice() {
		return basePrice;
	}

	public void setBasePrice(long basePrice) {
		this.basePrice = basePrice;
	}

	public long getShipping() {
		return shipping;
	}

	public void setShipping(long shipping) {
		this.shipping = shipping;
	}
	
	public long getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(long totalPrice) {
		this.totalPrice = totalPrice;
	}

	public boolean getIsDone() {
		return isDone;
	}

	public void setIsDone(boolean isDone) {
		this.isDone = isDone;
	}

	public String getDeliveryNo() {
		return deliveryNo;
	}

	public void setDeliveryNo(String deliveryNo) {
		this.deliveryNo = deliveryNo;
	}

	public String getDeliveryStreet() {
		return deliveryStreet;
	}

	public void setDeliveryStreet(String deliveryStreet) {
		this.deliveryStreet = deliveryStreet;
	}

	public String getDeliveryWard() {
		return deliveryWard;
	}

	public void setDeliveryWard(String deliveryWard) {
		this.deliveryWard = deliveryWard;
	}

	public String getDeliveryDistrict() {
		return deliveryDistrict;
	}

	public void setDeliveryDistrict(String deliveryDistrict) {
		this.deliveryDistrict = deliveryDistrict;
	}

	public String getDeliveryTime() {
		return deliveryTime;
	}

	public void setDeliveryTime(String deliveryTime) {
		this.deliveryTime = deliveryTime;
	}

	public String getDeleveryNote() {
		return deleveryNote;
	}

	public void setDeleveryNote(String deleveryNote) {
		this.deleveryNote = deleveryNote;
	}
	
	@Override
	public Date getCreated() {
		return this.created;
	}

	@Override
	public void setCreated(Date created) {
		this.created = created;
	}

	@Override
	public String getCreatedBy() {
		return this.createdBy;
	}

	@Override
	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
		
	}

	@Override
	public Date getLastModified() {	
		return this.lastModified;
	}

	@Override
	public void setLastModified(Date lastModified) {
		this.lastModified = lastModified;
	}

	@Override
	public String getLastModifiedBy() {
		return this.lastModifiedBy;
	}

	@Override
	public void setLastModifiedBy(String lastModifiedBy) {
		this.lastModifiedBy = lastModifiedBy;
	}
}
